package cn.db101.jcc.controller;

import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.db101.jcc.model.ResultModel;
import cn.db101.jcc.model.WxLoginModel;
import cn.db101.jcc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zooy
 * @create 2024-06-02 2:16
 * @description
 */
@RestController
@RequestMapping("v1/jcc")
public class WxLoginController {

    @Autowired
    private UserService userService;

    @PostMapping("wxLogin")
    public ResultModel wxLogin(@RequestBody WxLoginModel wxLoginModel) {

        return ResultModel.success(userService.wxLogin(wxLoginModel.getCode()));
    }

}
